
<?php
include('./selectcata.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>skull-网页书签收藏夹-首页</title>
    <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon">
    <link rel="stylesheet" href="./css/index.css">
    <script src="./js/jquery.min.js"></script>
    <script src="./js/home.js"></script>
    </script>
</head>
<body>
    <div class="nav">
        <div class="navbox">
            <div class="logo">
                <a href="http://www.kuloutou.top">
                    <img src="./images/logo.png" alt="">
                </a>
            </div>
            <div class="search">
                <input type="text" placeholder="搜索书签名称" id="searword" />
                <button type="submit" id="searbtn">搜索</button>
            </div>
            <div class="colorbar">
                <span></span>
                <span></span>
                <span></span>
                <span></span>
            </div>
            <div class="userbar">
                <img src="./images/iii.png" alt="">
                <div class="opt">
                    <?php
                    if (session_status() !== PHP_SESSION_ACTIVE) {
    	         session_start();
	    }
                    if(isset($_SESSION['username'])){  ?>
                        <span id="petname"><?php echo htmlentities($_SESSION['petname']); ?></span>
                        <span class="modify-petn"><a href="#" id="reuser">修改昵称</a></span>
                        <span class="exit"><a href="./logout.php">退出</a></span>
                    <?php 
                    }else {  ?>
                        <span>未登录</span>
                        <span class="tologin"><a href="login.html">点击登录</a></span>
                    <?php } ?>
                </div>
            </div>
        </div>
    </div>
    <div class="content">
        <div class="bookmarks">
            <ul flag="">
                <li>
                    <img src="./images/iii.png" alt="">
                    <span>骷髅头-首页</span>
                    <a href="http://www.kuloutou.top" target="_blank">http://www.kuloutou.top</a>
                    <div class="del">
                        <img src="./images/del.png" alt="">
                    </div>
                </li>
            </ul>
            <button id="addbook">+</button>
            <div class="pagination">
                <span id="homepage">首页</span>
                <span id="prepage">上一页</span>
                <div id="page" class="page"></div>
                <span id="nextpage">下一页</span>
                <span id="lastpage">尾页</span>
            </div>
        </div>
        <div class="catalogue">
            <h3>收藏夹</h3>
            <div class="btnbox">

            <?php if(isset($_SESSION['username'])){
            for($i=0;$i<$number;$i++){ ?>
                <button  flag=<?php echo $cata_id_arr[$i]; ?> >
                    <a href="#"><?php echo htmlentities($cata_name_arr[$i]); ?></a>
                    <img src="./images/alter.png" alt="" class="recatabtn">
                    <img src="./images/del.png" alt="" class="delcatabtn">
                </button>
            <?php }} ?>

            </div>
            <button id="addcata">+</button>
        </div>
    </div>

    <div class="footer fixed">
        <p>反馈邮箱：1421826010@qq.com</p>
    </div>

    <div class="dialogbox">
        <div class="dialog cata-dialog">
            <h3>输入新增收藏夹名称</h3>
            <p><input type="text" name="newcata"></p>
            <button class="cancel" type="button">取消</button>
            <button class="submit" id="toaddcata" type="submit">确认</button>
        </div>
        <div class="dialog recata-dialog">
            <h3>输入要更改的名称</h3>
            <input type="hidden" name="recata_id" id="recata_id"/>
            <p><input type="text" name="recata"></p>
            <button class="cancel" type="button">取消</button>
            <button class="submit" id="torecata" type="submit">确认</button>
        </div>
        <div class="dialog book-dialog">
            <h3>输入新增网址</h3>
            <p><input type="text" name="book"></p>
            <button class="cancel" type="button">取消</button>
            <button class="submit" id="toaddbook" type="submit">确认</button>
        </div>
        <div class="dialog reuser-dialog">
            <h3>输入要更改的昵称</h3>
            <p><input type="text" name="reuser"></p>
            <button class="cancel" type="button">取消</button>
            <button class="submit" id="toreuser" type="submit">确认</button>
        </div>
    </div>
</body>
</html>